rtc22 2.2.1
Loading...
Searching...
No Matches
rtc22.h File Reference

This file contains API for RTC 22 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  rtc22_t
 RTC 22 Click context object. More...
struct  rtc22_cfg_t
 RTC 22 Click configuration object. More...
struct  rtc22_time_t
 RTC 22 Click time object. More...
struct  rtc22_date_t
 RTC 22 Click date object. More...

Macros

#define RTC22_REG_HUNDREDTHS   0x00
 RTC 22 register list.
#define RTC22_REG_SECONDS   0x01
#define RTC22_REG_MINUTES   0x02
#define RTC22_REG_HOURS   0x03
#define RTC22_REG_DATE   0x04
#define RTC22_REG_MONTHS   0x05
#define RTC22_REG_YEARS   0x06
#define RTC22_REG_WEEKDAYS   0x07
#define RTC22_REG_HUNDREDTHS_ALARM   0x08
#define RTC22_REG_SECONDS_ALARM   0x09
#define RTC22_REG_MINUTES_ALARM   0x0A
#define RTC22_REG_HOURS_ALARM   0x0B
#define RTC22_REG_DATE_ALARM   0x0C
#define RTC22_REG_MONTHS_ALARM   0x0D
#define RTC22_REG_WEEKDAYS_ALARM   0x0E
#define RTC22_REG_STATUS   0x0F
#define RTC22_REG_CONTROL1   0x10
#define RTC22_REG_CONTROL2   0x11
#define RTC22_REG_INT_MASK   0x12
#define RTC22_REG_SQW   0x13
#define RTC22_REG_CAL_XT   0x14
#define RTC22_REG_CAL_RC_HI   0x15
#define RTC22_REG_CAL_RC_LOW   0x16
#define RTC22_REG_SLEEP_CONTROL   0x17
#define RTC22_REG_TIMER_CONTROL   0x18
#define RTC22_REG_TIMER   0x19
#define RTC22_REG_TIMER_INITIAL   0x1A
#define RTC22_REG_WDT   0x1B
#define RTC22_REG_OSC_CONTROL   0x1C
#define RTC22_REG_OSC_STATUS   0x1D
#define RTC22_REG_CONFIGURATION_KEY   0x1F
#define RTC22_REG_TRICKLE   0x20
#define RTC22_REG_BREF_CONTROL   0x21
#define RTC22_REG_AFCTRL   0x26
#define RTC22_REG_BATMODE_IO   0x27
#define RTC22_REG_ID0   0x28
#define RTC22_REG_ID1   0x29
#define RTC22_REG_ID2   0x2A
#define RTC22_REG_ID3   0x2B
#define RTC22_REG_ID4   0x2C
#define RTC22_REG_ID5   0x2D
#define RTC22_REG_ID6   0x2E
#define RTC22_REG_ASTAT   0x2F
#define RTC22_REG_OCTRL   0x30
#define RTC22_REG_EXTENSION_ADDRESS   0x3F
#define RTC22_REG_RAM   0x40
#define RTC22_MONDAY   0x00
 RTC 22 day of week values.
#define RTC22_TUESDAY   0x01
#define RTC22_WEDNESDAY   0x02
#define RTC22_THURSDAY   0x03
#define RTC22_FRIDAY   0x04
#define RTC22_SATURDAY   0x05
#define RTC22_SUNDAY   0x06
#define RTC22_DEVICE_ID   0x18
 RTC 22 device ID value.
#define RTC22_DEVICE_ADDRESS   0x69
 RTC 22 device address setting.
#define RTC22_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.

Enumerations

enum  rtc22_return_value_t { RTC22_OK = 0 , RTC22_ERROR = -1 }
 RTC 22 Click return value data. More...

Functions

void rtc22_cfg_setup (rtc22_cfg_t *cfg)
 RTC 22 configuration object setup function.
err_t rtc22_init (rtc22_t *ctx, rtc22_cfg_t *cfg)
 RTC 22 initialization function.
err_t rtc22_write_regs (rtc22_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 RTC 22 write regs function.
err_t rtc22_read_regs (rtc22_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 RTC 22 read regs function.
err_t rtc22_write_reg (rtc22_t *ctx, uint8_t reg, uint8_t data_in)
 RTC 22 write reg function.
err_t rtc22_read_reg (rtc22_t *ctx, uint8_t reg, uint8_t *data_out)
 RTC 22 read reg function.
void rtc22_set_wdi_pin (rtc22_t *ctx, uint8_t state)
 RTC 22 set WDI pin function.
uint8_t rtc22_get_psw_pin (rtc22_t *ctx)
 RTC 22 get PSW pin function.
uint8_t rtc22_get_tirq_pin (rtc22_t *ctx)
 RTC 22 get TIRQ pin function.
uint8_t rtc22_get_int_pin (rtc22_t *ctx)
 RTC 22 get INT pin function.
err_t rtc22_check_communication (rtc22_t *ctx)
 RTC 22 check communication function.
err_t rtc22_set_time (rtc22_t *ctx, rtc22_time_t *time)
 RTC 22 set time function.
err_t rtc22_read_time (rtc22_t *ctx, rtc22_time_t *time)
 RTC 22 read time function.
err_t rtc22_set_date (rtc22_t *ctx, rtc22_date_t *date)
 RTC 22 set date function.
err_t rtc22_read_date (rtc22_t *ctx, rtc22_date_t *date)
 RTC 22 read date function.

Detailed Description

This file contains API for RTC 22 Click Driver.

Enumeration Type Documentation

◆ rtc22_return_value_t

RTC 22 Click return value data.

Predefined enum values for driver return values.

Enumerator
RTC22_OK 
RTC22_ERROR